package com.example.itshome.onclick;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;

public class OnClickTurnTo implements View.OnClickListener {

    private final Context from;
    private final Class<? extends AppCompatActivity> to;
    public OnClickTurnTo(Context f,Class<? extends AppCompatActivity> t){from=f;to=t;}

    @Override
    public void onClick(View view) {
        Intent intent=new Intent(from,to);
        from.startActivity(intent);
    }
}
